package top.eggcode.template.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * web 配置
 * Created at 2021/11/17 22:51
 *
 * @author JiaQi Ding
 * @version 1.0
 */
@Configuration
public class SpringMvcConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 请求日志处理
        registry.addInterceptor(new LogInterceptor())
                .addPathPatterns("/api/**");
    }

}
